{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Title: #Minimum Time Visiting All Points"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Difficulty: #Easy"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Category Title: #Algorithms"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Tag Slug: #geometry #array #math"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Name Translated: #几何 #数组 #数学"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Solution Name: minTimeToVisitAllPoints"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Translated Title: #访问所有点的最小时间"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Translated Content:\n",
    "<p>平面上有 <code>n</code> 个点，点的位置用整数坐标表示 <code>points[i] = [x<sub>i</sub>, y<sub>i</sub>]</code> 。请你计算访问所有这些点需要的 <strong>最小时间</strong>（以秒为单位）。</p>\n",
    "\n",
    "<p>你需要按照下面的规则在平面上移动：</p>\n",
    "\n",
    "<ul>\n",
    "\t<li>每一秒内，你可以：\n",
    "\t<ul>\n",
    "\t\t<li>沿水平方向移动一个单位长度，或者</li>\n",
    "\t\t<li>沿竖直方向移动一个单位长度，或者</li>\n",
    "\t\t<li>跨过对角线移动 <code>sqrt(2)</code> 个单位长度（可以看作在一秒内向水平和竖直方向各移动一个单位长度）。</li>\n",
    "\t</ul>\n",
    "\t</li>\n",
    "\t<li>必须按照数组中出现的顺序来访问这些点。</li>\n",
    "\t<li>在访问某个点时，可以经过该点后面出现的点，但经过的那些点不算作有效访问。</li>\n",
    "</ul>\n",
    "\n",
    "<p> </p>\n",
    "\n",
    "<p><strong>示例 1：</strong></p>\n",
    "\n",
    "<p><img alt=\"\" src=\"https://assets.leetcode-cn.com/aliyun-lc-upload/uploads/2019/11/24/1626_example_1.png\" style=\"height: 428px; width: 500px;\" /></p>\n",
    "\n",
    "<pre>\n",
    "<strong>输入：</strong>points = [[1,1],[3,4],[-1,0]]\n",
    "<strong>输出：</strong>7\n",
    "<strong>解释：</strong>一条最佳的访问路径是： <strong>[1,1]</strong> -> [2,2] -> [3,3] -> <strong>[3,4] </strong>-> [2,3] -> [1,2] -> [0,1] -> <strong>[-1,0]</strong>   \n",
    "从 [1,1] 到 [3,4] 需要 3 秒 \n",
    "从 [3,4] 到 [-1,0] 需要 4 秒\n",
    "一共需要 7 秒</pre>\n",
    "\n",
    "<p><strong>示例 2：</strong></p>\n",
    "\n",
    "<pre>\n",
    "<strong>输入：</strong>points = [[3,2],[-2,2]]\n",
    "<strong>输出：</strong>5\n",
    "</pre>\n",
    "\n",
    "<p> </p>\n",
    "\n",
    "<p><strong>提示：</strong></p>\n",
    "\n",
    "<ul>\n",
    "\t<li><code>points.length == n</code></li>\n",
    "\t<li><code>1 <= n <= 100</code></li>\n",
    "\t<li><code>points[i].length == 2</code></li>\n",
    "\t<li><code>-1000 <= points[i][0], points[i][1] <= 1000</code></li>\n",
    "</ul>\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Description: [minimum-time-visiting-all-points](https://leetcode.cn/problems/minimum-time-visiting-all-points/description/)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Solutions: [minimum-time-visiting-all-points](https://leetcode.cn/problems/minimum-time-visiting-all-points/solutions/)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "test_cases = ['[[1,1],[3,4],[-1,0]]', '[[3,2],[-2,2]]']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "            ans = 0\n",
    "          \n",
    "            x = points[0][0]\n",
    "            y = points[0][1]\n",
    "            for a, b in points:\n",
    "                ans += max(abs(x - a), abs(y - b))\n",
    "                x, y = a, b\n",
    "            return ans"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        minTime = 0\n",
    "        x, y = points[0]\n",
    "\n",
    "        if len(points) == 1:\n",
    "            return minTime\n",
    "\n",
    "        for i in range(1, len(points)):\n",
    "            nextX, nextY = points[i]\n",
    "            minTime += max(abs(nextX-x), abs(nextY-y))\n",
    "            x, y = nextX, nextY\n",
    "        \n",
    "        return minTime\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        d = 0\n",
    "        for i in range(len(points) - 1):\n",
    "            x = abs(points[i][0] - points[i + 1][0])\n",
    "            y = abs(points[i][1] - points[i + 1][1])\n",
    "            d += min(x, y) + abs(x - y)\n",
    "        return d"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        an=0\n",
    "        begin=points[0]\n",
    "        for i in range(1,len(points)):\n",
    "            an+=max(abs(points[i][0]-begin[0]),abs(points[i][1]-begin[1]))\n",
    "            begin=points[i]\n",
    "        return an\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        res = 0\n",
    "        for i in range(len(points)-1):\n",
    "            #x = abs(points[i+1][0]-points[i][0])\n",
    "            #y = abs(points[i+1][1]-points[i][1])\n",
    "            x = points[i+1][0]-points[i][0]\n",
    "            if x<0:x=-x\n",
    "            y = points[i+1][1]-points[i][1]\n",
    "            if y<0:y=-y\n",
    "            res += x if x>y else y\n",
    "        return res"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        return sum(max(abs(points[i+1][0]-points[i][0]),abs(points[i+1][1]-points[i][1])) for i in range(len(points)-1))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        time = 0\n",
    "        for i in range(len(points) - 1):\n",
    "            x1, y1 = points[i]\n",
    "            x2, y2 = points[i + 1]\n",
    "            dx = abs(x2 - x1)\n",
    "            dy = abs(y2 - y1)\n",
    "            time += max(dx, dy)\n",
    "        return int(time)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        minTime = 0\n",
    "        x, y = points[0]\n",
    "\n",
    "        if len(points) == 1:\n",
    "            return minTime\n",
    "\n",
    "        for i in range(1, len(points)):\n",
    "            nextX, nextY = points[i]\n",
    "            minTime += max(abs(nextX-x), abs(nextY-y))\n",
    "            x, y = nextX, nextY\n",
    "        \n",
    "        return minTime\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        def calculateDistance(point1, point2):\n",
    "            x1, y1 = point1\n",
    "            x2, y2 = point2\n",
    "            dx = abs(x2 - x1)\n",
    "            dy = abs(y2 - y1)\n",
    "            return max(dx, dy)  # 选择最长的距离作为移动时间\n",
    "\n",
    "        total_time = 0\n",
    "\n",
    "        for i in range(1, len(points)):\n",
    "            total_time += calculateDistance(points[i-1], points[i])\n",
    "\n",
    "        return total_time"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        res = 0\n",
    "        length = len(points)\n",
    "        if (length <= 1):\n",
    "            return res\n",
    "        for i in range(1, length):\n",
    "            first = points[i-1]\n",
    "            second = points[i]\n",
    "            tmp = abs(first[0]-second[0])+abs(first[1]-second[1])\n",
    "            res += tmp-min(abs(first[0]-second[0]), abs(first[1]-second[1]))\n",
    "        return res"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        res = 0\n",
    "        for i in range(len(points)-1):\n",
    "            #x = abs(points[i+1][0]-points[i][0])\n",
    "            #y = abs(points[i+1][1]-points[i][1])\n",
    "            x = points[i+1][0]-points[i][0]\n",
    "            if x<0:x=-x\n",
    "            y = points[i+1][1]-points[i][1]\n",
    "            if y<0:y=-y\n",
    "            res += max(x,y)\n",
    "        return res"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        x0,y0=points[0]\n",
    "        ans=0\n",
    "        for i in range(1,len(points)):\n",
    "            x1,y1=points[i]\n",
    "            ans+=max(abs(x1-x0),abs(y1-y0))\n",
    "            x0,y0=points[i]\n",
    "        return ans"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        ans = 0\n",
    "        for i in range(1, len(points)):\n",
    "            l1 = abs(points[i][0]-points[i-1][0])\n",
    "            l2 = abs(points[i][1]-points[i-1][1])\n",
    "            ans += max(l1, l2)\n",
    "        return ans"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        res = 0\n",
    "        for i in range(len(points)-1):\n",
    "            res += max(abs(points[i][0]-points[i+1][0]),abs(points[i][1]-points[i+1][1]))\n",
    "        return res\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        def calculateDistance(point1, point2):\n",
    "            x1, y1 = point1\n",
    "            x2, y2 = point2\n",
    "            dx = abs(x2 - x1)\n",
    "            dy = abs(y2 - y1)\n",
    "            return max(dx, dy)  # 选择最长的距离作为移动时间\n",
    "\n",
    "        total_time = 0\n",
    "\n",
    "        for i in range(1, len(points)):\n",
    "            total_time += calculateDistance(points[i-1], points[i])\n",
    "\n",
    "        return total_time"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        ans=0\n",
    "        x1,y1=points[0]\n",
    "        for point in points:\n",
    "            x2,y2=point\n",
    "            ans+=max(abs(x2-x1),abs(y2-y1))\n",
    "            x1,y1=point\n",
    "        return ans"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        walkingtotal=0\n",
    "        for i in range(len(points)-1):\n",
    "            listfrom=points[i]\n",
    "            listto=points[i+1]\n",
    "            deltx=abs(listfrom[0]-listto[0])\n",
    "            delty=abs(listfrom[1]-listto[1])\n",
    "            walkingtotal+=max(deltx,delty)\n",
    "        return walkingtotal            "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        if not points:\n",
    "            return None\n",
    "        \n",
    "        res = 0\n",
    "        start = points[0]\n",
    "        for i, point in enumerate(points):\n",
    "            if i == 0:\n",
    "                continue\n",
    "            end = point\n",
    "            deltaX = abs(end[0] - start[0])\n",
    "            deltaY = abs(end[1] - start[1])\n",
    "            res += max(deltaX, deltaY)\n",
    "            start = end\n",
    "        return res"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        res = 0\n",
    "        def dis(x,y):\n",
    "            return max(abs(x[0]-y[0]),abs(x[1]-y[1]))\n",
    "        for i in range(1,len(points)):\n",
    "            res = res+dis(points[i-1],points[i])\n",
    "        return res\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        t=sum([max(abs(points[i][0]-points[i-1][0]),abs(points[i][1]-points[i-1][1])) for i in range(1,len(points))])\n",
    "        return t"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        res = 0\n",
    "        for i in range(len(points) - 1):\n",
    "            res += max(abs(points[i][0] - points[i+1][0]), abs(points[i][1] - points[i+1][1]))\n",
    "        return res"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        t=0\n",
    "        for i in range(1,len(points)):\n",
    "            t=t+max(abs(points[i][0]-points[i-1][0]),abs(points[i][1]-points[i-1][1]))\n",
    "        return t"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        ans = 0\n",
    "        n = len(points)\n",
    "        for i in range(1, n):\n",
    "            x = abs(points[i][0] - points[i - 1][0])\n",
    "            y = abs(points[i][1] - points[i - 1][1])\n",
    "            ans += max(x, y)\n",
    "        return ans"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        ans = 0\n",
    "        for i in range(1,len(points)):\n",
    "            ans += max(abs(points[i][0]-points[i-1][0]),abs(points[i][1]-points[i-1][1]))\n",
    "\n",
    "        return ans"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        res=0\n",
    "        a,b=points[0][0],points[0][1]\n",
    "        n=len(points)\n",
    "        for i in range(1,n):\n",
    "            res+=max(abs(points[i][0]-a),abs(points[i][1]-b))\n",
    "            a,b=points[i][0],points[i][1]\n",
    "        return res"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        ans = 0\n",
    "        x, y = points[0]\n",
    "        for point in points:\n",
    "            a, b = point\n",
    "            ans += max(abs(x - a), abs(y - b))\n",
    "            x, y = point\n",
    "        \n",
    "        return ans"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        \"\"\"\n",
    "        必须按照 数组中出现的顺序来访问这些点。两个点之间的距离是，横纵坐标差值较大的。\n",
    "        \"\"\"\n",
    "        n = len(points)\n",
    "        ans = 0\n",
    "        for i in range(1, n):\n",
    "            l = max(abs(points[i][0] - points[ i - 1][0]), abs(points[i][1] - points[i- 1][1]))\n",
    "            ans += l\n",
    "        return ans\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        result=0\n",
    "        for i in range(len(points)-1):\n",
    "            p1=points[i]\n",
    "            p2=points[i+1]\n",
    "            result+=max(abs(p1[1]-p2[1]),abs(p1[0]-p2[0]))\n",
    "        return result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        x0, y0 = points[0]\n",
    "        times = 0\n",
    "        for i in range(1, len(points)):\n",
    "            x1, y1 = points[i]\n",
    "            times += max(abs(x0 - x1), abs(y0 - y1))\n",
    "            x0 = x1\n",
    "            y0 = y1\n",
    "\n",
    "        return times    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        an=0\n",
    "        begin=points[0]\n",
    "        for i in range(1,len(points)):\n",
    "            an+=max(abs(points[i][0]-begin[0]),abs(points[i][1]-begin[1]))\n",
    "            begin=points[i]\n",
    "        return an\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        ans = 0\n",
    "        x, y = points[0]\n",
    "        for nx, ny in points:\n",
    "            ans += max(abs(nx - x), abs(ny - y))\n",
    "            x, y = nx, ny\n",
    "        return ans"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        minTime = 0\n",
    "        x, y = points[0]\n",
    "\n",
    "        # if len(points) == 1:\n",
    "        #     return minTime\n",
    "\n",
    "        for i in range(1, len(points)):\n",
    "            nextX, nextY = points[i]\n",
    "            minTime += max(abs(nextX-x), abs(nextY-y))\n",
    "            x, y = nextX, nextY\n",
    "        \n",
    "        return minTime\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        \"\"\"\n",
    "        必须按照 数组中出现的顺序来访问这些点。两个点之间的距离是，横纵坐标差值较大的。\n",
    "        \"\"\"\n",
    "        n = len(points)\n",
    "        ans = 0\n",
    "        for i in range(1, n):\n",
    "            l = max(abs(points[i][0] - points[ i - 1][0]), abs(points[i][1] - points[i- 1][1]))\n",
    "            ans += l\n",
    "        return ans\n",
    "\n",
    "        \"\"\"\n",
    "        a切比雪夫距离，将x 移动到y 处最少次数为dx， dy的较大值，dx = abs(x0 - y0) dy = abs(x1 - y1)\n",
    "        \"\"\"\n",
    "        # x0, x1 = points[0]\n",
    "        # ans = 0\n",
    "        # for i in range(1, len(points)):\n",
    "        #     y0, y1 = points[i]\n",
    "        #     ans += max(abs(x0 - y0), abs(x1 - y1))\n",
    "        #     x0, x1 = points[i]\n",
    "        # return ans\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        sums = 0\n",
    "        for i in range(len(points)-1):\n",
    "            p0 = points[i]\n",
    "            p1 = points[i+1]\n",
    "            sums += max(abs(p0[0]-p1[0]), abs(p0[1]-p1[1]))\n",
    "        return sums\n",
    "            \n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        return sum(max((abs(points[i + 1][0] - points[i][0]), abs(points[i + 1][1] - points[i][1]))) for i in range(len(points) - 1))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        distance = []\n",
    "        i = 0\n",
    "        while i < len(points) - 1:\n",
    "           distance.append(max(abs(points[i][0] - points[i+1][0]), abs(points[i][1] - points[i+1][1])))\n",
    "           i += 1\n",
    "           \n",
    "        return sum(distance)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        res = 0\n",
    "        for i in range(1,len(points)):\n",
    "            res = res + max(abs(points[i][0]-points[i-1][0]),abs(points[i][1]-points[i-1][1]))\n",
    "        return res\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "from typing import List\n",
    "\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        def get(point1, point2):\n",
    "            a = abs(point1[0] - point2[0])\n",
    "            b = abs(point1[1] - point2[1])\n",
    "            return abs(a - b) + min(a, b)\n",
    "\n",
    "        n = len(points)\n",
    "        ans = 0\n",
    "        for i in range(n - 1):\n",
    "            ans += get(points[i], points[i + 1])\n",
    "        return ans\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        n = len(points)\n",
    "        res = 0\n",
    "        for i in range(n - 1):\n",
    "            point_0,point_1 = points[i],points[i + 1]\n",
    "            x,y = abs(point_0[0] - point_1[0]), abs(point_0[1] - point_1[1])\n",
    "            res += min(x, y) + abs(x - y)\n",
    "        return res"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        steps=0\n",
    "        for i in range(1,len(points)):\n",
    "            steps+=max(abs(points[i][0]-points[i-1][0]),abs(points[i][1]-points[i-1][1]))\n",
    "        return steps\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        res = 0\n",
    "        for i in range(len(points)-1):\n",
    "            x = abs(points[i+1][0]-points[i][0])\n",
    "            y = abs(points[i+1][1]-points[i][1])\n",
    "            res += max(x,y)\n",
    "        return res"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        ans = 0\n",
    "        for p1, p2 in pairwise(points):\n",
    "            ans += max(abs(p1[0] - p2[0]), abs(p1[1] - p2[1]))\n",
    "        return ans\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        ans = 0 \n",
    "        for a,b in pairwise(points) :\n",
    "            diff_x = abs(a[0]-b[0]) \n",
    "            diff_y = abs(a[1]-b[1]) \n",
    "            if diff_x > diff_y :\n",
    "                ans += diff_x\n",
    "            else : \n",
    "                ans += diff_y\n",
    "            \n",
    "        return ans "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        \"\"\"\n",
    "        必须按照 数组中出现的顺序来访问这些点。两个点之间的距离是，横纵坐标差值较大的。\n",
    "        \"\"\"\n",
    "        n = len(points)\n",
    "        ans = 0\n",
    "        for i in range(1, n):\n",
    "            l = max(abs(points[i][0] - points[ i - 1][0]), abs(points[i][1] - points[i- 1][1]))\n",
    "            ans += l\n",
    "        return ans\n",
    "\n",
    "        \"\"\"\n",
    "        a切比雪夫距离，将x 移动到y 处最少次数为dx， dy的较大值，dx = abs(x0 - y0) dy = abs(x1 - y1)\n",
    "        \"\"\"\n",
    "        # x0, x1 = points[0]\n",
    "        # ans = 0\n",
    "        # for i in range(1, len(points)):\n",
    "        #     y0, y1 = points[i]\n",
    "        #     ans += max(abs(x0 - y0), abs(x1 - y1))\n",
    "        #     x0, x1 = points[i]\n",
    "        # return ans\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        def reducer(list1, list2):\n",
    "            if len(list1) > len(list2):\n",
    "                return reducer(list2, list1)\n",
    "            return [abs(list1[i] - list2[i]) for i in range(len(list1))]\n",
    "        ans = 0\n",
    "        start = points[0]\n",
    "        for point in points[0:]:\n",
    "            time = max(reducer(point,start))\n",
    "            start = point\n",
    "            ans += time\n",
    "        return ans"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        x0, x1 = points[0]\n",
    "        ans = 0\n",
    "        for i in range(1, len(points)):\n",
    "            y0, y1 = points[i]\n",
    "            ans += max(abs(x0 - y0), abs(x1 - y1))\n",
    "            x0, x1 = points[i]\n",
    "        return ans\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        return sum(max(abs(p1[0] - p2[0]), abs(p1[1] - p2[1])) for p1, p2 in zip(points, points[1:]))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        ans = 0\n",
    "        x, y = points[0]\n",
    "        for nx, ny in points:\n",
    "            ans += max(abs(nx - x), abs(ny - y))\n",
    "            x, y = nx, ny\n",
    "        return ans"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\r\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\r\n",
    "        dis = 0\r\n",
    "        for i in range(1, len(points)):\r\n",
    "            dis += max(abs(points[i][0] - points[i - 1][0]), \r\n",
    "                       abs(points[i][1] - points[i - 1][1]))\r\n",
    "        return dis"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        def cntDistance(p1, p2):\n",
    "            hor, ver = abs(p1[0]-p2[0]), abs(p1[1]-p2[1])\n",
    "            # dia = min(hor, ver)\n",
    "            return max(hor, ver)\n",
    "        \n",
    "        res = 0\n",
    "        pre = points[0]\n",
    "        for i in range(1, len(points)):\n",
    "            res += cntDistance(pre, points[i])\n",
    "            pre = points[i]\n",
    "        \n",
    "        return res"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        distance, location = 0, points[0]\n",
    "        for p in range(1, len(points)):\n",
    "            a = abs(points[p][0] - location[0])\n",
    "            b = abs(points[p][1] - location[1])\n",
    "            distance += a if a > b else b\n",
    "            location = points[p]\n",
    "        return distance"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        result=0\n",
    "        for i in range(len(points)-1):\n",
    "            p1=points[i]\n",
    "            p2=points[i+1]\n",
    "            result+=max(abs(p1[1]-p2[1]),abs(p1[0]-p2[0]))\n",
    "        return result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        x0, x1 = points[0]\n",
    "        ans = 0\n",
    "        for i in range(1, len(points)):\n",
    "            y0, y1 = points[i]\n",
    "            ans += max(abs(x0 - y0), abs(x1 - y1))\n",
    "            x0, x1 = points[i]\n",
    "        return ans"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "from functools import reduce\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        s = 0\n",
    "        l = len(points)\n",
    "        for x in range(l-1):\n",
    "            s += max(abs(points[x][0]-points[x+1][0]),abs(points[x][1]-points[x+1][1]))\n",
    "        return s\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        ans = 0\n",
    "        n = len(points)\n",
    "        for i in range(n-1):\n",
    "            dx = abs(points[i][0]-points[i+1][0])\n",
    "            dy = abs(points[i][1]-points[i+1][1])\n",
    "            ans += max(dx,dy)\n",
    "        return ans"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        res = 0\n",
    "        for i in range(len(points) - 1):\n",
    "            res += max(abs(points[i][0] - points[i + 1][0]), abs(points[i][1] - points[i + 1][1]))\n",
    "        return res"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        res = 0\n",
    "        n = len(points)\n",
    "        if n == 1:\n",
    "            return 0\n",
    "        for i in range(1, n):\n",
    "            res += max(abs(points[i][0] - points[i - 1][0]), abs(points[i][1] - points[i - 1][1]))\n",
    "        return res"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        left_lst = []\n",
    "        right_lst = []\n",
    "        for i in range(len(points)):\n",
    "            left_lst.append(points[i][0])\n",
    "            right_lst.append(points[i][1])\n",
    "\n",
    "        time = 0\n",
    "        for i in range(len(left_lst)):\n",
    "            lst1 = []\n",
    "            if i + 1 < len(left_lst):\n",
    "                a = abs(left_lst[i] - left_lst[i+1])\n",
    "                lst1.append(a)\n",
    "            if i + 1 < len(right_lst):\n",
    "                b = abs(right_lst[i] - right_lst[i+1])\n",
    "                lst1.append(b)\n",
    "\n",
    "            if len(lst1) !=  0:\n",
    "                time += max(lst1)\n",
    "        return time"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        t = 0\n",
    "        for i, pair in enumerate(points[:-1]):\n",
    "            t += max(abs(pair[0]-points[i+1][0]), abs(pair[1]-points[i+1][1]))\n",
    "        return t\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        def computer(point1,point2):\n",
    "            ans = 0\n",
    "            while True:\n",
    "                x1,y1=point1\n",
    "                x2,y2=point2\n",
    "                if x1!=x2 and y1!=y2:\n",
    "                    if x1>x2:\n",
    "                        point1[0]-=1\n",
    "                    else:\n",
    "                        point1[0]+=1\n",
    "                    if y1>y2:\n",
    "                        point1[1]-=1\n",
    "                    else:\n",
    "                        point1[1]+=1\n",
    "                    ans+=1\n",
    "                    continue\n",
    "                if y1!=y2:\n",
    "                    if y1>y2:\n",
    "                        point1[1]-=1\n",
    "                    else:\n",
    "                        point1[1]+=1\n",
    "                    ans+=1\n",
    "                    continue\n",
    "                if x1!=x2:\n",
    "                    if x1>x2:\n",
    "                        point1[0]-=1\n",
    "                    else:\n",
    "                        point1[0]+=1\n",
    "                    ans+=1\n",
    "                    continue\n",
    "                break\n",
    "            return ans\n",
    "        out = 0\n",
    "        for i in range(len(points)-1):\n",
    "            out+=computer(points[i],points[i+1])\n",
    "            print(out)\n",
    "        return out"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        ans = 0\n",
    "        sx, sy = points[0][0], points[0][1]\n",
    "        for x, y in points:\n",
    "            ans += max(abs(x - sx), abs(y - sy))\n",
    "            sx, sy = x, y\n",
    "        return ans"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        ans = 0\n",
    "        for i in range(1, len(points)):\n",
    "            x1, y1 = points[i - 1][0], points[i - 1][1]\n",
    "            x2, y2 = points[i][0], points[i][1]\n",
    "            if abs(x1 - x2) > abs(y1 - y2):\n",
    "                ans += abs(x1 - x2)\n",
    "            else:\n",
    "                ans += abs(y1 - y2)\n",
    "        return ans"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        x0, y0 = points[0]\n",
    "        ans = 0\n",
    "        for i in range(1, len(points)):\n",
    "            x1, y1 = points[i]\n",
    "            ans += max(abs(x0 - x1), abs(y0 - y1))\n",
    "            x0, y0 = points[i]\n",
    "        return ans"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        n=len(points)\n",
    "        res=0\n",
    "        for i in range(1,n):\n",
    "            res+=max(abs(points[i][0]-points[i-1][0]),abs(points[i][1]-points[i-1][1]))\n",
    "        return res"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        n=len(points)\n",
    "        res = 0\n",
    "        for i in range(1,n):\n",
    "            x1,y1 = points[i-1][0],points[i-1][1]\n",
    "            x2,y2=points[i][0],points[i][1]\n",
    "            disx = abs(x1-x2)\n",
    "            disy = abs(y1-y2)\n",
    "            res += max(disx,disy)\n",
    "        return res"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "from itertools import pairwise # need Python >= 3.10\n",
    "\n",
    "def time_needed(p1, p2):\n",
    "    return max(abs(p1[0]-p2[0]), abs(p1[1]-p2[1]))\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        return sum(time_needed(p1, p2) for p1, p2 in pairwise(points))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from typing import List\n",
    "import collections\n",
    "\n",
    "class Solution:\n",
    "    def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:\n",
    "        def reducer(list1, list2):\n",
    "            # 考虑两数组长度不相等的情况\n",
    "            # if len(list1) > len(list2):\n",
    "            #     return reducer(list2, list1)\n",
    "            return [abs(list1[i] - list2[i]) for i in range(len(list1))]\n",
    "        ans = 0\n",
    "        # 设置points第一个点为起始点，从第二个点开始遍历\n",
    "        start = points[0]\n",
    "        for point in points[0:]:\n",
    "            time = max(reducer(point,start))\n",
    "            # 将起始点更新为遍历后的点\n",
    "            start = point\n",
    "            ans += time\n",
    "        return ans"
   ]
  }
 ],
 "metadata": {},
 "nbformat": 4,
 "nbformat_minor": 2
}
